# -*- coding: utf-8 -*-

"""
DateTime   : 2020/12/17 19:33
Author     : ZhangYafei
Description: 
"""
a = (x for x in range(10))
print(a) # <generator object <genexpr> at 0x000001DB6DD91748>

def fibonacci():
    a = 0
    b = 1
    while True:
        yield a
        future = a + b
        a = b
        b = future


if __name__ == '__main__':
    fib = fibonacci()
    for _ in range(10):
        print(next(fib))
    """
    0
    1
    1
    2
    3
    5
    8
    13
    21
    34
    """